function letterCombinations(digits: string): string[] {
  const ans: string[] = [];
  const alphabet = {
    '2': 'abc',
    '3': 'def',
    '4': 'ghi',
    '5': 'jkl',
    '6': 'mno',
    '7': 'pqrs',
    '8': 'tuv',
    '9': 'wxyz',
  };
  if (digits === '') return [];
  dfs(0, '');
  return ans;
  function dfs(index: number, str: string) {
    if (index === digits.length) {
      ans.push(str);
      return;
    }
    for (let s of alphabet[digits[index]]) {
      dfs(index + 1, str + s);
    }

  }
};